function setSwitchStatus(obj, switchId, token){
  let domain = location.host;
  let url = 'http://'+domain+'/admin/setSwitchStatus';
  console.log(switchId);
  console.log(obj.is(':checked'));
  let data = {
      _token: token,
      switchId: switchId
  }
  if (obj.is(':checked')) {
    data.status = 1;
  } else {
    data.status = 0;
  }
  console.log(url);
  $.ajax({
        type : "POST",
        url : url,
        data : data,
        success : function(result) {
            console.log(result)
            if (result.code == 1) {
                location.reload();
                console.log(result)
            } else {
                console.log(result)
            }
        },
        //请求失败，包含具体的错误信息
        error : function(e){
            layer.close(e);
            console.log(e.status);
            console.log(e.responseText);
        }
    });

}